package roborally.model.executables.commands;

import roborally.model.*;
import roborally.model.executables.RobotCommand;
/**
 * RobotCommand that lets the robot shoot in its current orientation.
 */
public class Shoot extends RobotCommand {

	public Shoot(Robot robot, Program program) {
		super(robot, program);
	}
	/**
	 * @effect If the robot has energy to shoot, it will shoot its laser.
	 */
	@Override
	public void executeCommand() {
		if(getRobot().hasEnergyToShoot())
			getRobot().shoot();
	}
	
	@Override
	public String toString(){
		return "shoot";
	}

}
